using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using bitzhuwei.Compiler;

namespace bitzhuwei.AnsiCFormat {
    /// <summary>
    /// Correspond to the Vn node expression_statement in the grammar(AnsiC).
    /// </summary>
    internal partial class Vnexpression_statement : Vnstatement {
        // [189]=expression_statement : ';' ;
        // [190]=expression_statement : expression ';' ;

        /// <summary>
        /// [189]=expression_statement : ';' ;
        /// [190]=expression_statement : expression ';' ;
        /// </summary>
        /// <param name="r1"></param>
        /// <param name="r0"></param>
        public Vnexpression_statement(Vnexpression? r1, Token r0) {
            this.r1 = r1;
            this.r0 = r0;
            if (r1 != null) { this._scope = new TokenRange(r1, r0); }
            else { this._scope = new TokenRange(r0); }
        }

        private readonly Vnexpression? r1;
        private readonly Token r0;
        private readonly TokenRange _scope;

        public override TokenRange Scope => _scope;

        public override void Format(TextWriter writer, FormatContext context) {
            throw new NotImplementedException();
        }

        public override void FullFormat(BlankConfig preConfig, TextWriter writer, FormatContext context) {
            throw new NotImplementedException();
        }

        public override IEnumerable<string> YieldTokens(TextWriter writer, FormatContext context) {
            throw new NotImplementedException();
        }

    }
}
